/******************************************************************************/
/* log_def.h                                                                  */
/******************************************************************************/

#ifndef __LOG_DEF_H
#define __LOG_DEF_H


/*************************** Constants for MLOG *******************************/
#define LOG_FLG_OK_VAL       (0xAA55AA55)
#define LOG_MAX_PARAM        (32) 
#define LOG_READ_MAX_SIZE    (240)       


/*********************** Prototypes & struct for MLOG *************************/
typedef enum
{
    eEL_RESET = 0,
    eEL_DIN_ON,
    eEL_DIN_OFF,
    eEL_AIN_MAX,
    eEL_AIN_MIN,
    eEL_TEMP_MAX,
    eEL_TEMP_MIN,
    eEL_SP_UPPER,
    eEL_SP_UPPER_RET,
    eEL_SP_LOWER,
    eEL_SP_LOWER_RET,
    eEL_SMS_TX,
    eEL_SMS_RX,
    eEL_UNDEF
} __TYPE_EVENT_LOG;


typedef struct
{
    uint32_t isLogOk;
    uint32_t head;
    uint32_t tile;
    uint32_t recNum;
} __TOOLS_BRAM_LOG;


#pragma pack(1)
typedef struct
SETT_HEADER_LOG
{
    SETT_HEADER_LOG() : time_period(0), flash_mem_size(0),
                        size_cutoff(0), rec_size(0) {}

    uint32_t time_period;
    uint32_t flash_mem_size;
    uint32_t rec_size;
    uint32_t size_cutoff;
} __SETT_HEADER_LOG;


typedef struct
SETT_PARAM_LOG
{
    SETT_PARAM_LOG() : device_id(0), param_id(0), rfile_addr(0), param_type(0xFF) {}

    uint32_t device_id;
    uint16_t param_id;
    uint16_t rfile_addr;
    uint8_t param_type;
} __SETT_PARAM_LOG;


typedef struct
HEADER_LOG
{
    HEADER_LOG() : recNum(0), timeStamp(0), event(0xFFFF) {}

    uint32_t recNum;
    uint32_t timeStamp;
    uint16_t event;
} __HEADER_LOG;


typedef struct
DATA_EVENT_LOG
{
    DATA_EVENT_LOG() : event(eEL_UNDEF),
                       data1(0),
                       data2(0),
                       data3(0) {}
    uint16_t event;
    uint16_t data1;
    uint16_t data2;
    uint16_t data3;
} __DATA_EVENT_LOG;
#pragma pack()

#endif